package com.qd.pay.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 退款单
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_order_refund")
public class OrderRefund extends Model<OrderRefund> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "rid", type = IdType.ASSIGN_ID)
    private String rid;
    /**
     * 商户订单号
     */
    @TableField("out_trade_no")
    private String outTradeNo;
    /**
     * 支付系统订单号:微信订单号
     */
    @TableField("transaction_id")
    private String transactionId;
    /**
     * 商户退款单号
     */
    @TableField("out_refund_no")
    private String outRefundNo;
    /**
     * 订单金额
     */
    @TableField("pay_amount")
    private BigDecimal payAmount;
    /**
     * 退款金额
     */
    @TableField("refund_fee")
    private BigDecimal refundFee;
    /**
     * 退款原因
     */
    @TableField("refund_desc")
    private String refundDesc;
    /**
     * 终端IP
     */
    @TableField("ip_address")
    private String ipAddress;
    /**
     * 操作人
     */
    @TableField("personid")
    private String personId;
    /**
     * AP编号
     */
    @TableField("apcode")
    private String apCode;
    /**
     * 退款提交时间
     */
    @TableField("send_time")
    private LocalDateTime sendTime;
    /**
     * 退款编号:从1开始
     */
    @TableField("refund_no")
    private Integer refundNo;
    /**
     * 通知回执地址
     */
    @TableField("notify_url")
    private String notifyUrl;
    /**
     * 订单ID
     */
    @TableField("order_id")
    private String orderId;

    public void freeData() {
        this.rid = null;
        this.outTradeNo = null;
        this.transactionId = null;
        this.outRefundNo = null;
        this.payAmount = null;
        this.refundFee = null;
        this.refundDesc = null;
        this.ipAddress = null;
        this.personId = null;
        this.apCode = null;
        this.sendTime = null;
        this.refundNo = null;
        this.notifyUrl = null;
        this.orderId = null;
    }

}
